fn main() {

    // loop
    loop {
        println!("inside loop");
        break;
    }

    // loop 返回值
    let mut i = 0;
    let mut j = loop {
        i += 1;
        if i >= 10 {
            break i;
        }
    };
    println!("j: {}", j);

    i = 0;
    // while
    while i < 10 {
        println!("i: {}", i);
        i += 1;
    }


    // for
    let names = ["Alice", "Bob", "Y"];
    for name in names.iter() {
        println!("name: {}", name);
    }

    // for a range
    for num in 1..10 {
        println!("num: {}", num);
    }

    println!("Hello, world!");
}
